home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK1.toast / Development Kits (Disc 1) / QuickDraw GX / Programming Stuff / Sample Code / Printing Samples / Printer Drivers… / HPXL / ChooserSupport.r < prev    next >
Encoding:
Text File  |  1996-06-15  |  6.3 KB  |  247 lines  |  [TEXT/MPS ]

  1. /*
  2.     ChooserSupport.r - other resources needed in order for driver to work
  3.         with the Chooser.
  4.     
  5.     Copyright © 1993-1996 Apple Computer, Inc.
  6.     All rights reserved.
  7.     
  8.     12/20/93        dmh        Sync'd up for GX 1.0b3.
  9.      8/28/94        dmh        Sync'd up for GX 1.0.1.
  10.      6/14/96        cn        Updated to support Universal Interfaces 2.1.
  11. */
  12.  
  13. // System 7.0 Compatible
  14. #define SystemSevenOrLater        1
  15.  
  16. #include "Types.r"
  17. #include "SysTypes.r"
  18. #include "GXPrintingResTypes.r"
  19.  
  20. // what type of communication does this device use (this is the default, as the actual
  21. // value can be found in the desktop printer).
  22. resource 'look' (-4096, sysheap, purgeable) {
  23.     1,                // use the second in our list by default
  24.     
  25.     {
  26.     "Serial",        -4096,        iconCells,                        "Modem Port";
  27.     "Servers",        -4094,        isAppleTalk+isPrinterShare,        "HPXLShared";
  28.     };
  29. };
  30.  
  31. /* ===== 'comm' - specifies the printer shared settings for device ===== */
  32.  
  33. resource 'comm' (-4094, sysheap, purgeable) {
  34.     PrinterShare
  35.         {
  36.         "",
  37.         0
  38.         };
  39. };
  40.  
  41. /* ===== 'comm' - specifies the default communication settings for device ===== */
  42.  
  43. resource 'comm' (-4096, sysheap, purgeable)        // Normally the 'comm' resource used is in the desktop printer
  44. {
  45.     Serial
  46.     {
  47.         baud9600,            // Output baud rate
  48.         noParity,            // Output parity
  49.         oneStop,                // Output stop bits
  50.         data8,                // Output data size
  51.         0x00010000,            // Output handshaking
  52.         0x00000000,
  53.         baud9600,            // Input baud rate
  54.         noParity,            // Input parity
  55.         oneStop,                // Input stop bits
  56.         data8,                // Input data bits
  57.         0,                        // Input handshaking
  58.         0,
  59.         1024,                    // Input buffer size
  60.         ".AIn",                // Input driver name
  61.         ".AOut"                // Output driver name
  62.     }    
  63. };
  64.  
  65.  
  66.  
  67.  
  68.  
  69. /*********************************************************************************************
  70.     STANDARD CHOOSER PACK STUFF
  71. *********************************************************************************************/
  72.  
  73. // NBP Lookup type (maxed out so resource file won't need updating)
  74. resource 'STR ' (-4096, sysheap, purgeable)
  75. {
  76.     "XXXXXXXXXXXXXXXXXXXXXX";
  77. };
  78.  
  79. // NBP timeout value
  80. type 'GNRL'
  81. {
  82.     byte;    // timeout
  83.     byte;    // retries
  84. };
  85.  
  86. resource 'GNRL' (-4096, sysheap, purgeable)
  87. {
  88.     11,
  89.     5
  90. };
  91.  
  92. // title string (we'll put a control here, so we don't want a title)
  93. resource 'STR ' (-4091, sysheap, purgeable)
  94. {
  95.     "";
  96. };
  97.  
  98. // "left" button title
  99. resource 'STR ' (-4093, sysheap, purgeable)
  100. {
  101.     "Create";
  102. };
  103.  
  104. // rectangle list
  105. resource 'nrct' (-4096, sysheap, purgeable) {
  106.     {
  107.     {112, 251, 132, 311};            // left button
  108.     {0,0,0,0};                            // right button
  109.     {-101, 180, -101+20, 400};        // on button (location of device list - popup is placed here)
  110.     {0,0,0,0};                            // off button
  111.     {0,0,0,0};                            // button label
  112.     };
  113. };
  114.  
  115. // Menu used to select between direct connect, AppleTalk, and Servers
  116. resource 'MENU' (-4096, sysheap, purgeable)
  117. {
  118.     -4096,
  119.     textMenuProc,
  120.     0xFFFFFFFF,    
  121.     enabled,
  122.     "",
  123.     {
  124.     }
  125. };
  126.  
  127. // Pop-up control used to select between direct connect printers and those being shared on the network
  128. resource 'CNTL' (-4096, sysheap, purgeable)
  129. {
  130.     {0, 0, 20, 213},                            // zero based control location
  131.     0,                                                // Title options 0 = Left justified
  132.     visible,                                        // Should we display the control?
  133.     95,                                            // Title Width
  134.     -4096,                                        // 'MENU' to display
  135.     popupMenuCDEFproc+popupFixedWidth,    // CDEF = CDEFID * 16 + varCode
  136.     0,                                             // refCon = ResType to append = None
  137.     "Connect via:"                                // Control title
  138. };
  139.  
  140. resource 'DITL' (-4096, sysheap, purgeable) 
  141. {
  142.     {
  143.         {3, 238, 23, 238 + 213}, 
  144.             Control {enabled, -4096},
  145.     };
  146. };
  147.  
  148.  
  149. resource 'DITL' (-4095, sysheap, purgeable) {
  150.     {    /* array DITLarray: 2 elements */
  151.         /* [1] */
  152.         {143, 310, 163, 368},
  153.         Button {
  154.             enabled,
  155.             "OK"
  156.         },
  157.         /* [2] */
  158.         {23, 87, 119, 377},
  159.         StaticText {
  160.             disabled,
  161.             "This printer driver could not be used.\n\n"
  162.             "Quitting one or more applications and then "
  163.             "trying again may allow you to use this "
  164.             "printer driver."
  165.         }
  166.     }
  167. };
  168.  
  169. resource 'ALRT' (-4095, sysheap, purgeable) {
  170.     {38, 30, 231, 456},
  171.     -4095,
  172.     {    /* array: 4 elements */
  173.         /* [1] */
  174.         OK, visible, sound1,
  175.         /* [2] */
  176.         OK, visible, sound1,
  177.         /* [3] */
  178.         OK, visible, sound1,
  179.         /* [4] */
  180.         OK, visible, sound1
  181.     },
  182.     alertPositionParentWindowScreen
  183. };
  184.  
  185. //-----------------------------------------------------------------------------------
  186. // CHOOSER PACK HELP RESOURCES
  187. //-----------------------------------------------------------------------------------
  188.  
  189.  
  190. /*    Any Chooser package can get balloons on all items that are normally 
  191.     added to the Chooser dialog by containing a STR# resource of 
  192.     resource ID = PackResID (-5694) and following the convention below:
  193.         
  194.         resource 'STR#' (-5694, sysheap, purgeable) {
  195.           {        "kEnabledLeftButton";    // message for button (or control) that is Enabled but not checked
  196.                 "kDisabledLeftButton";    // message for the control that is Disabled
  197.                 "kCheckedLeftButton";    // message for the control that is Checked (ie CtrlValue>0)
  198.                 "kOtherLeftButton";        // message for the control that is Other (ie CtrlValue>1)
  199.                 "kEnabledRightButton";
  200.                 "kDisabledRightButton";
  201.                 "kCheckedRightButton";
  202.                 "kOtherRightButton";
  203.                 "kEnabledOnButton";
  204.                 "kDisabledOnButton";
  205.                 "kCheckedOnButton";
  206.                 "kOtherOnButton";
  207.                 "kEnabledOffButton";
  208.                 "kDisabledOffButton";
  209.                 "kCheckedOffButton";
  210.                 "kOtherOffButton";
  211.                 "kEnabledOnOffTitle";
  212.                 "kDisabledOnOffTitle";
  213.                 "kCheckedOnOffTitle";
  214.                 "kOtherOnOffTitle";
  215.           }
  216.         };
  217.         
  218.     This is a horrible Chooser hack for 7.0 - but we'll follow along in GX.
  219. */
  220.  
  221. resource 'STR#' (-5694, sysheap, purgeable) {
  222.   {        
  223.   
  224.           "Click here to create a desktop printer for the selected device."; // message for button (or control) that is Enabled but not checked
  225.         "You have not selected a device to create, or there is not enough memory to create a desktop printer at this time.";    // message for the control that is Disabled
  226.         "";    // message for the control that is Checked (ie CtrlValue>0)
  227.         "";    // message for the control that is Other (ie CtrlValue>1)
  228.         "";    // kEnabledRightButton
  229.         "";    // kDisabledRightButton
  230.         "";    // kCheckedRightButton
  231.         "";    // kOtherRightButton
  232.         "Use this pop–up menu to select the type of connection for the desktop printer you are creating.";
  233.         "";    // kDisabledOnButton
  234.         "";    // kCheckedOnButton 
  235.         "";    // kOtherOnButton
  236.         "";    // kEnabledOffButton
  237.         "";    // kDisabledOffButton
  238.         "";    // kCheckedOffButton
  239.         "";    // kOtherOffButton
  240.         "";    // kEnabledOnOffTitle
  241.         "";    // kDisabledOnOffTitle
  242.         "";    // kCheckedOnOffTitle
  243.         "";    // kOtherOnOffTitle
  244.   }
  245. };
  246.  
  247.